<template>
  <div class="top-comment">
    <div class="title">
      <h1>{{value.comment_tpye === 'hot' ? '最热评论' : '最新评论'}}</h1>
      <span>{{value.total}}条</span>
    </div>
    <div class="top-container">
      <div class="top-item"
           v-for="item in value.rows"
           :key="item.id">
        <img :src="item.u_pic"
             alt="图片">
        <div class="user">
          <span class="nickname">{{item.u_name}}</span>
          <p>{{item.msg}}</p>
          <div class="reply" v-if="item.reply">
              <span class="reply-name">@{{item.reply.u_name}}</span>
              <span>{{item.reply.msg}}</span>
          </div>
          <span class="time">{{item.time}}</span>
        </div>
      </div>
    </div>
    <!-- <div class="pagination" v-if="value.comment_tpye === 'normal'">
      <el-pagination class="pag-item"
                     size="middle"
                     background
                     :total="value.totalPage"
                     :current-page="value.currentPage"
                     @current-change="changePage"
                     layout="prev, pager, next">
      </el-pagination>
    </div> -->
  </div>
</template>

<script>
export default {
  name: 'Talking',
  props: ['value'],
  methods: {
    changePage () {
    }
  }
}
</script>

<style lang="less" scoped>
.top-comment {
  margin-top: 50px;
  .title {
    display: flex;
    align-items: end;
    h1 {
      margin-right: 20px;
      font-size: 24px;
    }
    span {
      font-size: 14px;
    }
  }
  .top-container {
    .top-item {
      display: flex;
      margin-top: 30px;
      img {
        height: 42px;
        width: 42px;
        border-radius: 50%;
      }
      .user {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex-grow: 1;
        margin-left: 20px;
        height: 100%;
        border-bottom: 1px solid #eee;
        padding: 0 0 20px 0;
        .nickname {
          font-weight: bold;
          font-size: 16px;
        }
        .reply {
          border-left: 1px solid #ccc;
          font-size: 16px;
          .reply-name {
            color: #296294;
            margin: 0 5px 0 10px;
            cursor: pointer;
          }
        }
        p {
          font-size: 14px;
          padding: 10px 0;
        }
        .time {
          color: #999;
        }
      }
    }
  }
  .pagination {
    text-align: center;
    margin: 48px 0 30px 0;
    /deep/ .el-pager {
      .number,
      .more {
        width: 42px;
        height: 42px;
        text-align: center;
        line-height: 42px;
        color: #333;
        background-color: transparent;
      }
      .number.active {
        background-color: rgb(255, 223, 31);
      }
    }
    /deep/ .btn-prev,
    /deep/ .btn-next {
      width: 42px;
      height: 42px;
      text-align: center;
      line-height: 42px;
      background-color: transparent;
    }
  }
}
</style>